package Ali;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author zhangmin
 * @create 2022-03-25 9:42
 */
public class Ali_0325_1 {
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int t=cin.nextInt();
        cin.nextLine();
        Set<String> set=new HashSet<>();
        for (int i = 0; i < t; i++) {
            String name=cin.nextLine();
            int len=name.length();
            if (len<6||len>12){
                System.out.println("illegal length");
            }else {
                int j = 0;
                for (; j < len; j++) {
                    if (Character.isLetter(name.charAt(j))){
                     continue;
                    }else {
                        System.out.println("illegal charactor");
                        break;
                    }
                }
                if (j==len){
                    if (set.contains(name)){
                        System.out.println("acount exited");
                    }else {
                        set.add(name);
                        System.out.println("registration complete");
                    }
                }
            }
        }
    }
}
